// Upgraded to Delphi 2009: Sebastian Zierer

(* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is TurboPower SysTools
 *
 * The Initial Developer of the Original Code is
 * TurboPower Software
 *
 * Portions created by the Initial Developer are Copyright (C) 1996-2002
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * ***** END LICENSE BLOCK ***** *)

{*********************************************************}
{* SysTools: StSaturn.pas 4.04                           *}
{*********************************************************}
{* SysTools: Astronomical Routines (for Saturn)          *}
{*********************************************************}

{$I StDefine.inc}

unit StSaturn;

interface

uses
  StAstroP;

function ComputeSaturn(JD : Double) : TStEclipticalCord;


implementation

function GetLongitude(Tau, Tau2, Tau3, Tau4, Tau5 : Double) : Double;
var
  L0, L1,
  L2, L3,
  L4, L5  : Double;
begin
  L0 := 0.87401354029 * cos(0.00000000000 +    0.00000000000 * Tau)
      + 0.11107659780 * cos(3.96205090190 +  213.29909544000 * Tau)
      + 0.01414150958 * cos(4.58581515870 +    7.11354700080 * Tau)
      + 0.00398379386 * cos(0.52112025957 +  206.18554844000 * Tau)
      + 0.00350769223 * cos(3.30329903020 +  426.59819088000 * Tau)
      + 0.00206816296 * cos(0.24658366938 +  103.09277422000 * Tau)
      + 0.00079271288 * cos(3.84007078530 +  220.41264244000 * Tau)
      + 0.00023990338 * cos(4.66976934860 +  110.20632122000 * Tau)
      + 0.00016573583 * cos(0.43719123541 +  419.48464388000 * Tau)
      + 0.00015820300 * cos(0.93808953760 +  632.78373931000 * Tau)
      + 0.00015053509 * cos(2.71670027880 +  639.89728631000 * Tau)
      + 0.00014906995 * cos(5.76903283840 +  316.39186966000 * Tau)
      + 0.00014609562 * cos(1.56518573690 +    3.93215326310 * Tau)
      + 0.00013160308 * cos(4.44891180180 +   14.22709400200 * Tau)
      + 0.00013005305 * cos(5.98119067060 +   11.04570026400 * Tau)
      + 0.00010725066 * cos(3.12939596470 +  202.25339517000 * Tau)
      + 0.00006126308 * cos(1.76328499660 +  277.03499374000 * Tau)
      + 0.00005863207 * cos(0.23657028777 +  529.69096509000 * Tau)
      + 0.00005227771 * cos(4.20783162380 +    3.18139373770 * Tau)
      + 0.00005019658 * cos(3.17787919530 +  433.71173788000 * Tau)
      + 0.00004592541 * cos(0.61976424374 +  199.07200144000 * Tau)
      + 0.00004005862 * cos(2.24479893940 +   63.73589830300 * Tau)
      + 0.00003873696 * cos(3.22282692570 +  138.51749687000 * Tau)
      + 0.00003269490 * cos(0.77491895787 +  949.17560897000 * Tau)
      + 0.00002953815 * cos(0.98280385206 +   95.97922721800 * Tau)
      + 0.00002461172 * cos(2.03163631210 +  735.87651353000 * Tau)
      + 0.00001758143 * cos(3.26580514770 +  522.57741809000 * Tau)
      + 0.00001640183 * cos(5.50504966220 +  846.08283475000 * Tau)
      + 0.00001580641 * cos(4.37266314120 +  309.27832266000 * Tau)
      + 0.00001391336 * cos(4.02331978120 +  323.50541666000 * Tau)
      + 0.00001123515 * cos(2.83726793570 +  415.55249061000 * Tau)
      + 0.00001087237 * cos(4.18343232480 +    2.44768055480 * Tau)
      + 0.00001017258 * cos(3.71698151810 +  227.52618944000 * Tau)
      + 0.00000956752 * cos(0.50740889886 + 1265.56747860000 * Tau)
      + 0.00000852677 * cos(3.42141350700 +  175.16605980000 * Tau)
      + 0.00000848643 * cos(3.19149825840 +  209.36694217000 * Tau)
      + 0.00000789205 * cos(5.00745123150 +    0.96320784650 * Tau)
      + 0.00000748811 * cos(2.14398149300 +  853.19638175000 * Tau)
      + 0.00000743584 * cos(5.25276954620 +  224.34479570000 * Tau)
      + 0.00000686965 * cos(1.74714407830 + 1052.26838320000 * Tau)
      + 0.00000654470 * cos(1.59889331510 +    0.04818410980 * Tau)
      + 0.00000633980 * cos(2.29889903020 +  412.37109687000 * Tau)
      + 0.00000624904 * cos(0.97046831256 +  210.11770170000 * Tau)
      + 0.00000579857 * cos(3.09259007050 +   74.78159856700 * Tau)
      + 0.00000546358 * cos(2.12678554210 +  350.33211960000 * Tau)
      + 0.00000542643 * cos(1.51824320510 +    9.56122755560 * Tau)
      + 0.00000529861 * cos(4.44938897120 +  117.31986822000 * Tau)
      + 0.00000478054 * cos(2.96488054340 +  137.03302416000 * Tau)
      + 0.00000474279 * cos(5.47527185990 +  742.99006053000 * Tau)
      + 0.00000451827 * cos(1.04436664240 +  490.33408918000 * Tau)
      + 0.00000448542 * cos(1.28990416160 +  127.47179661000 * Tau)
      + 0.00000372308 * cos(2.27819108630 +  217.23124870000 * Tau)
      + 0.00000354944 * cos(3.01286483030 +  838.96928775000 * Tau)
      + 0.00000347413 * cos(1.53928227760 +  340.77089205000 * Tau)
      + 0.00000343475 * cos(0.24604039134 +    0.52126486180 * Tau)
      + 0.00000330196 * cos(0.24715617844 + 1581.95934830000 * Tau)
      + 0.00000322185 * cos(0.96137456104 +  203.73786788000 * Tau)
      + 0.00000321543 * cos(2.57182354540 +  647.01083331000 * Tau)
      + 0.00000309001 * cos(3.49486734910 +  216.48048918000 * Tau)
      + 0.00000286688 * cos(2.37043745860 +  351.81659231000 * Tau)
      + 0.00000277775 * cos(0.40020408926 +  211.81462273000 * Tau)
      + 0.00000249116 * cos(1.47010534420 + 1368.66025280000 * Tau)
      + 0.00000226609 * cos(4.91003163140 +   12.53017297200 * Tau)
      + 0.00000220225 * cos(4.20422424870 +  200.76892247000 * Tau)
      + 0.00000208655 * cos(1.34516255300 +  625.67019231000 * Tau)
      + 0.00000207663 * cos(0.48349820488 + 1162.47470440000 * Tau)
      + 0.00000207659 * cos(1.28302218900 +   39.35687591500 * Tau)
      + 0.00000204500 * cos(6.01082206600 +  265.98929348000 * Tau)
      + 0.00000184690 * cos(3.50344404960 +  149.56319713000 * Tau)
      + 0.00000183511 * cos(0.97254952728 +    4.19278569400 * Tau)
      + 0.00000182454 * cos(5.49122292430 +    2.92076130680 * Tau)
      + 0.00000173914 * cos(1.86305806810 +    0.75075952540 * Tau)
      + 0.00000164541 * cos(0.44005517520 +    5.41662597140 * Tau)
      + 0.00000149299 * cos(5.73594349790 +   52.69019803900 * Tau)
      + 0.00000147526 * cos(1.53529320510 +    5.62907429250 * Tau)
      + 0.00000146068 * cos(6.23102544070 +  195.13984817000 * Tau)
      + 0.00000139666 * cos(4.29450260070 +   21.34064100200 * Tau)
      + 0.00000131283 * cos(4.06828961900 +   10.29494073800 * Tau)
      + 0.00000124969 * cos(6.27737805830 + 1898.35121790000 * Tau)
      + 0.00000122373 * cos(1.97588777200 +    4.66586644600 * Tau)
      + 0.00000118156 * cos(5.34072933900 +  554.06998748000 * Tau)
      + 0.00000117283 * cos(2.67920400580 + 1155.36115740000 * Tau)
      + 0.00000113747 * cos(5.59427544710 + 1059.38193020000 * Tau)
      + 0.00000112437 * cos(1.10502663530 +  191.20769491000 * Tau)
      + 0.00000110399 * cos(0.16604024090 +    1.48447270830 * Tau)
      + 0.00000109275 * cos(3.43812715690 +  536.80451210000 * Tau)
      + 0.00000106570 * cos(4.01156608510 +  956.28915597000 * Tau)
      + 0.00000103956 * cos(2.19210363070 +   88.86568021700 * Tau)
      + 0.00000102702 * cos(1.19748124060 + 1685.05212250000 * Tau)
      + 0.00000100631 * cos(4.96513666540 +  269.92144674000 * Tau);

  L1 := 213.54295596000 * cos(0.00000000000 +   0.00000000000 * Tau)
      + 0.01296855005 * cos(1.82820544700 +  213.29909544000 * Tau)
      + 0.00564347566 * cos(2.88500136430 +    7.11354700080 * Tau)
      + 0.00107678770 * cos(2.27769911870 +  206.18554844000 * Tau)
      + 0.00098323030 * cos(1.08070061330 +  426.59819088000 * Tau)
      + 0.00040254586 * cos(2.04128257090 +  220.41264244000 * Tau)
      + 0.00019941734 * cos(1.27954662740 +  103.09277422000 * Tau)
      + 0.00010511706 * cos(2.74880392800 +   14.22709400200 * Tau)
      + 0.00006939233 * cos(0.40493079985 +  639.89728631000 * Tau)
      + 0.00004803325 * cos(2.44194097670 +  419.48464388000 * Tau)
      + 0.00004056325 * cos(2.92166618780 +  110.20632122000 * Tau)
      + 0.00003768630 * cos(3.64965631460 +    3.93215326310 * Tau)
      + 0.00003384684 * cos(2.41694251650 +    3.18139373770 * Tau)
      + 0.00003302200 * cos(1.26256486710 +  433.71173788000 * Tau)
      + 0.00003071382 * cos(2.32739317750 +  199.07200144000 * Tau)
      + 0.00001953036 * cos(3.56394683300 +   11.04570026400 * Tau)
      + 0.00001249348 * cos(2.62803737520 +   95.97922721800 * Tau)
      + 0.00000921683 * cos(1.96089834250 +  227.52618944000 * Tau)
      + 0.00000705587 * cos(4.41689249330 +  529.69096509000 * Tau)
      + 0.00000649654 * cos(6.17418093660 +  202.25339517000 * Tau)
      + 0.00000627603 * cos(6.11088227170 +  309.27832266000 * Tau)
      + 0.00000486843 * cos(6.03998200310 +  853.19638175000 * Tau)
      + 0.00000478501 * cos(4.98776987980 +  522.57741809000 * Tau)
      + 0.00000468377 * cos(4.61707843910 +   63.73589830300 * Tau)
      + 0.00000417010 * cos(2.11708169280 +  323.50541666000 * Tau)
      + 0.00000407630 * cos(1.29949556680 +  209.36694217000 * Tau)
      + 0.00000352489 * cos(2.31707079460 +  632.78373931000 * Tau)
      + 0.00000343826 * cos(3.95854178570 +  412.37109687000 * Tau)
      + 0.00000339724 * cos(3.63396398750 +  316.39186966000 * Tau)
      + 0.00000335936 * cos(3.77173072710 +  735.87651353000 * Tau)
      + 0.00000331933 * cos(2.86077699880 +  210.11770170000 * Tau)
      + 0.00000289429 * cos(2.73263080240 +  117.31986822000 * Tau)
      + 0.00000280911 * cos(5.74398845420 +    2.44768055480 * Tau)
      + 0.00000265801 * cos(0.54344631312 +  647.01083331000 * Tau)
      + 0.00000230493 * cos(1.64428879620 +  216.48048918000 * Tau)
      + 0.00000191667 * cos(2.96512946580 +  224.34479570000 * Tau)
      + 0.00000172891 * cos(4.07695221040 +  846.08283475000 * Tau)
      + 0.00000167131 * cos(2.59745202660 +   21.34064100200 * Tau)
      + 0.00000136328 * cos(2.28580246630 +   10.29494073800 * Tau)
      + 0.00000131364 * cos(3.44108355650 +  742.99006053000 * Tau)
      + 0.00000127838 * cos(4.09533471250 +  217.23124870000 * Tau)
      + 0.00000108862 * cos(6.16141072260 +  415.55249061000 * Tau)
      + 0.00000097584 * cos(4.72845436680 +  838.96928775000 * Tau)
      + 0.00000093909 * cos(3.48397279900 + 1052.26838320000 * Tau)
      + 0.00000092482 * cos(3.94755499930 +   88.86568021700 * Tau)
      + 0.00000086600 * cos(1.21951325060 +  440.82528488000 * Tau)
      + 0.00000083463 * cos(3.11269504720 +  625.67019231000 * Tau)
      + 0.00000077588 * cos(6.24408938830 +  302.16477566000 * Tau)
      + 0.00000067106 * cos(0.28961738595 +    4.66586644600 * Tau)
      + 0.00000065843 * cos(5.64757042730 +    9.56122755560 * Tau)
      + 0.00000061900 * cos(4.29344363380 +  127.47179661000 * Tau)
      + 0.00000061557 * cos(1.82789612600 +  195.13984817000 * Tau)
      + 0.00000057780 * cos(2.47630552040 +  191.95845444000 * Tau)
      + 0.00000056919 * cos(5.01889578110 +  137.03302416000 * Tau)
      + 0.00000054585 * cos(0.28356341456 +   74.78159856700 * Tau)
      + 0.00000054160 * cos(5.12628572380 +  490.33408918000 * Tau)
      + 0.00000051425 * cos(1.45766406060 +  536.80451210000 * Tau)
      + 0.00000046799 * cos(1.17721211050 +  149.56319713000 * Tau)
      + 0.00000046649 * cos(5.14818326900 +  515.46387109000 * Tau)
      + 0.00000045891 * cos(2.23198878760 +  956.28915597000 * Tau)
      + 0.00000044444 * cos(2.70873627670 +    5.41662597140 * Tau)
      + 0.00000040400 * cos(0.41281520440 +  269.92144674000 * Tau)
      + 0.00000040380 * cos(3.88870105680 +  728.76296653000 * Tau)
      + 0.00000037969 * cos(0.64665967180 +  422.66603761000 * Tau)
      + 0.00000037768 * cos(2.53379013860 +   12.53017297200 * Tau)
      + 0.00000037191 * cos(3.78239026410 +    2.92076130680 * Tau)
      + 0.00000035116 * cos(6.08421794090 +    5.62907429250 * Tau)
      + 0.00000033778 * cos(3.21070688050 + 1368.66025280000 * Tau)
      + 0.00000033217 * cos(4.64063092110 +  277.03499374000 * Tau)
      + 0.00000033050 * cos(5.43038091190 + 1066.49547720000 * Tau)
      + 0.00000032857 * cos(0.30063884563 +  351.81659231000 * Tau)
      + 0.00000031876 * cos(4.38622923770 + 1155.36115740000 * Tau)
      + 0.00000031329 * cos(2.43455855530 +   52.69019803900 * Tau)
      + 0.00000030276 * cos(2.84067004930 +  203.00415470000 * Tau)
      + 0.00000030089 * cos(6.18684614310 +  284.14854074000 * Tau)
      + 0.00000029667 * cos(3.39052569130 + 1059.38193020000 * Tau)
      + 0.00000028913 * cos(2.02614760510 +  330.61896366000 * Tau)
      + 0.00000028264 * cos(2.74178954000 +  265.98929348000 * Tau)
      + 0.00000026493 * cos(4.51214170120 +  340.77089205000 * Tau);

  L2 := 0.00116441181 * cos(1.17987850630 +    7.11354700080 * Tau)
      + 0.00091920844 * cos(0.07425261094 +  213.29909544000 * Tau)
      + 0.00090592251 * cos(0.00000000000 +    0.00000000000 * Tau)
      + 0.00015276909 * cos(4.06492007500 +  206.18554844000 * Tau)
      + 0.00010631396 * cos(0.25778277414 +  220.41264244000 * Tau)
      + 0.00010604979 * cos(5.40963595890 +  426.59819088000 * Tau)
      + 0.00004265368 * cos(1.04595556630 +   14.22709400200 * Tau)
      + 0.00001215527 * cos(2.91860042120 +  103.09277422000 * Tau)
      + 0.00001164684 * cos(4.60942128970 +  639.89728631000 * Tau)
      + 0.00001081967 * cos(5.69130351670 +  433.71173788000 * Tau)
      + 0.00001044754 * cos(4.04206453610 +  199.07200144000 * Tau)
      + 0.00001020079 * cos(0.63369182642 +    3.18139373770 * Tau)
      + 0.00000633582 * cos(4.38825410040 +  419.48464388000 * Tau)
      + 0.00000549329 * cos(5.57303134240 +    3.93215326310 * Tau)
      + 0.00000456914 * cos(1.26840971350 +  110.20632122000 * Tau)
      + 0.00000425100 * cos(0.20935499279 +  227.52618944000 * Tau)
      + 0.00000273739 * cos(4.28841011780 +   95.97922721800 * Tau)
      + 0.00000161571 * cos(1.38139149420 +   11.04570026400 * Tau)
      + 0.00000129494 * cos(1.56586884170 +  309.27832266000 * Tau)
      + 0.00000117008 * cos(3.88120915960 +  853.19638175000 * Tau)
      + 0.00000105415 * cos(4.90003203600 +  647.01083331000 * Tau)
      + 0.00000100967 * cos(0.89270493100 +   21.34064100200 * Tau)
      + 0.00000095659 * cos(2.91093561540 +  316.39186966000 * Tau)
      + 0.00000095227 * cos(5.62561150600 +  412.37109687000 * Tau)
      + 0.00000084860 * cos(5.73472777960 +  209.36694217000 * Tau)
      + 0.00000082727 * cos(6.05030934790 +  216.48048918000 * Tau)
      + 0.00000081948 * cos(1.02477558310 +  117.31986822000 * Tau)
      + 0.00000074857 * cos(4.76178468160 +  210.11770170000 * Tau)
      + 0.00000067184 * cos(0.45648612616 +  522.57741809000 * Tau)
      + 0.00000066459 * cos(0.48297940601 +   10.29494073800 * Tau)
      + 0.00000063696 * cos(0.35179804917 +  323.50541666000 * Tau)
      + 0.00000060647 * cos(4.87517850190 +  632.78373931000 * Tau)
      + 0.00000053281 * cos(2.74730541390 +  529.69096509000 * Tau)
      + 0.00000045827 * cos(5.69296621750 +  440.82528488000 * Tau)
      + 0.00000045293 * cos(1.66856699800 +  202.25339517000 * Tau)
      + 0.00000042330 * cos(5.70768187700 +   88.86568021700 * Tau)
      + 0.00000032140 * cos(0.07050050346 +   63.73589830300 * Tau)
      + 0.00000031573 * cos(1.67190022210 +  302.16477566000 * Tau)
      + 0.00000031150 * cos(4.16379537690 +  191.95845444000 * Tau)
      + 0.00000026558 * cos(0.83256214407 +  224.34479570000 * Tau)
      + 0.00000024631 * cos(5.65564728570 +  735.87651353000 * Tau)
      + 0.00000020108 * cos(5.94364609980 +  217.23124870000 * Tau)
      + 0.00000017511 * cos(4.90014736800 +  625.67019231000 * Tau)
      + 0.00000017130 * cos(1.62593421270 +  742.99006053000 * Tau)
      + 0.00000016040 * cos(0.57886320845 +  515.46387109000 * Tau)
      + 0.00000014068 * cos(0.20675293700 +  838.96928775000 * Tau)
      + 0.00000013744 * cos(3.76497167300 +  195.13984817000 * Tau)
      + 0.00000012236 * cos(4.71789723980 +  203.00415470000 * Tau)
      + 0.00000011940 * cos(0.12620714199 +  234.63973644000 * Tau)
      + 0.00000011718 * cos(3.12098483550 +  846.08283475000 * Tau)
      + 0.00000011154 * cos(5.92216844780 +  536.80451210000 * Tau)
      + 0.00000011013 * cos(5.60207982770 +  728.76296653000 * Tau)
      + 0.00000010601 * cos(3.20327613030 + 1066.49547720000 * Tau)
      + 0.00000010240 * cos(4.98736656070 +  422.66603761000 * Tau)
      + 0.00000010072 * cos(0.25709351996 +  330.61896366000 * Tau)
      + 0.00000009962 * cos(4.15472049130 +  860.30992875000 * Tau)
      + 0.00000009490 * cos(0.46379969328 +  956.28915597000 * Tau)
      + 0.00000008287 * cos(2.13990364270 +  269.92144674000 * Tau)
      + 0.00000007730 * cos(5.24602742310 +  429.77958461000 * Tau)
      + 0.00000007550 * cos(4.03401153930 +    9.56122755560 * Tau)
      + 0.00000007238 * cos(5.39724715260 + 1052.26838320000 * Tau)
      + 0.00000006353 * cos(4.46211130730 +  284.14854074000 * Tau)
      + 0.00000006082 * cos(5.93416924840 +  405.25754987000 * Tau);

  L3 := 0.00016038734 * cos(5.73945377420 +    7.11354700080 * Tau)
      + 0.00004249793 * cos(4.58539675600 +  213.29909544000 * Tau)
      + 0.00001906524 * cos(4.76082050210 +  220.41264244000 * Tau)
      + 0.00001465687 * cos(5.91326678320 +  206.18554844000 * Tau)
      + 0.00001162041 * cos(5.61973132430 +   14.22709400200 * Tau)
      + 0.00001066581 * cos(3.60816533140 +  426.59819088000 * Tau)
      + 0.00000239377 * cos(3.86088273440 +  433.71173788000 * Tau)
      + 0.00000236975 * cos(5.76826451460 +  199.07200144000 * Tau)
      + 0.00000165641 * cos(5.11641150220 +    3.18139373770 * Tau)
      + 0.00000151352 * cos(2.73594641860 +  639.89728631000 * Tau)
      + 0.00000131409 * cos(4.74327544610 +  227.52618944000 * Tau)
      + 0.00000063365 * cos(0.22850089497 +  419.48464388000 * Tau)
      + 0.00000061630 * cos(4.74287052460 +  103.09277422000 * Tau)
      + 0.00000040437 * cos(5.47298059140 +   21.34064100200 * Tau)
      + 0.00000040205 * cos(5.96420266720 +   95.97922721800 * Tau)
      + 0.00000038746 * cos(5.83386199530 +  110.20632122000 * Tau)
      + 0.00000028025 * cos(3.01235311510 +  647.01083331000 * Tau)
      + 0.00000025029 * cos(0.98808170740 +    3.93215326310 * Tau)
      + 0.00000019014 * cos(1.91614237460 +  853.19638175000 * Tau)
      + 0.00000018262 * cos(4.96738415930 +   10.29494073800 * Tau)
      + 0.00000018101 * cos(1.02506397060 +  412.37109687000 * Tau)
      + 0.00000017919 * cos(4.20376505350 +  216.48048918000 * Tau)
      + 0.00000017879 * cos(3.31913418970 +  309.27832266000 * Tau)
      + 0.00000016208 * cos(3.89825272750 +  440.82528488000 * Tau)
      + 0.00000015763 * cos(5.61667809630 +  117.31986822000 * Tau)
      + 0.00000012947 * cos(1.18068953940 +   88.86568021700 * Tau)
      + 0.00000011453 * cos(5.57520615100 +   11.04570026400 * Tau)
      + 0.00000010548 * cos(5.92906266270 +  191.95845444000 * Tau)
      + 0.00000010389 * cos(3.94838736950 +  209.36694217000 * Tau)
      + 0.00000008650 * cos(3.39335369700 +  302.16477566000 * Tau)
      + 0.00000007580 * cos(4.87736913160 +  323.50541666000 * Tau)
      + 0.00000006697 * cos(0.38198725552 +  632.78373931000 * Tau)
      + 0.00000006327 * cos(2.25492722760 +  522.57741809000 * Tau)
      + 0.00000005864 * cos(1.05621157680 +  210.11770170000 * Tau)
      + 0.00000005449 * cos(4.64268475490 +  234.63973644000 * Tau)
      + 0.00000003701 * cos(3.14159265360 +    0.00000000000 * Tau)
      + 0.00000003602 * cos(2.30677010960 +  515.46387109000 * Tau)
      + 0.00000003229 * cos(2.20309400070 +  860.30992875000 * Tau)
      + 0.00000002850 * cos(0.58604395010 +  529.69096509000 * Tau)
      + 0.00000002583 * cos(4.93447677060 +  224.34479570000 * Tau)
      + 0.00000002543 * cos(0.42393884183 +  625.67019231000 * Tau)
      + 0.00000002421 * cos(4.76621391810 +  330.61896366000 * Tau)
      + 0.00000002296 * cos(3.34809165900 +  429.77958461000 * Tau)
      + 0.00000002213 * cos(3.19814958290 +  202.25339517000 * Tau)
      + 0.00000002194 * cos(1.18918501010 + 1066.49547720000 * Tau)
      + 0.00000002154 * cos(1.35488209140 +  405.25754987000 * Tau)
      + 0.00000002090 * cos(4.15631351320 +  223.59403618000 * Tau)
      + 0.00000002018 * cos(3.06693569700 +  654.12438032000 * Tau);

  L4 := 0.00001661894 * cos(3.99826248980 +   7.11354700080 * Tau)
      + 0.00000257107 * cos(2.98436499010 + 220.41264244000 * Tau)
      + 0.00000236344 * cos(3.90241428080 +  14.22709400200 * Tau)
      + 0.00000149418 * cos(2.74110824210 + 213.29909544000 * Tau)
      + 0.00000113953 * cos(3.14159265360 +   0.00000000000 * Tau)
      + 0.00000109598 * cos(1.51515739250 + 206.18554844000 * Tau)
      + 0.00000068390 * cos(1.72120953340 + 426.59819088000 * Tau)
      + 0.00000040060 * cos(2.04644897410 + 433.71173788000 * Tau)
      + 0.00000037699 * cos(1.23795458360 + 199.07200144000 * Tau)
      + 0.00000031219 * cos(3.01094184090 + 227.52618944000 * Tau)
      + 0.00000015111 * cos(0.82897064529 + 639.89728631000 * Tau)
      + 0.00000009444 * cos(3.71485300870 +  21.34064100200 * Tau)
      + 0.00000005690 * cos(2.41995290630 + 419.48464388000 * Tau)
      + 0.00000005608 * cos(1.15607095740 + 647.01083331000 * Tau)
      + 0.00000004470 * cos(1.45120818750 +  95.97922721800 * Tau)
      + 0.00000004463 * cos(2.11783225180 + 440.82528488000 * Tau)
      + 0.00000003229 * cos(4.09278077830 + 110.20632122000 * Tau)
      + 0.00000002871 * cos(2.77203153870 + 412.37109687000 * Tau)
      + 0.00000002796 * cos(3.00730249560 +  88.86568021700 * Tau)
      + 0.00000002638 * cos(0.00255721254 + 853.19638175000 * Tau)
      + 0.00000002574 * cos(0.39246854091 + 103.09277422000 * Tau)
      + 0.00000002225 * cos(3.77689198140 + 117.31986822000 * Tau);

  L5 := 0.00000123615 * cos(2.25923345730 +   7.11354700080 * Tau)
      + 0.00000034190 * cos(2.16250652690 +  14.22709400200 * Tau)
      + 0.00000027546 * cos(1.19868150220 + 220.41264244000 * Tau)
      + 0.00000005818 * cos(1.21584270180 + 227.52618944000 * Tau)
      + 0.00000005318 * cos(0.23550400093 + 433.71173788000 * Tau)
      + 0.00000003677 * cos(6.22669694360 + 426.59819088000 * Tau)
      + 0.00000003057 * cos(2.97372046320 + 199.07200144000 * Tau)
      + 0.00000002861 * cos(4.28710932680 + 206.18554844000 * Tau);

  Result := (L0 + L1*Tau + L2*Tau2 + L3*Tau3 + L4*Tau4 + L5*Tau5);
end;

{---------------------------------------------------------------------------}

function GetLatitude(Tau, Tau2, Tau3, Tau4, Tau5 : Double) : Double;
var
  B0, B1,
  B2, B3,
  B4, B5  : Double;
begin
  B0 := 0.04330678040 * cos(3.60284428400 + 213.29909544000 * Tau)
      + 0.00240348303 * cos(2.85238489390 + 426.59819088000 * Tau)
      + 0.00084745939 * cos(0.00000000000 +   0.00000000000 * Tau)
      + 0.00034116063 * cos(0.57297307844 + 206.18554844000 * Tau)
      + 0.00030863357 * cos(3.48441504470 + 220.41264244000 * Tau)
      + 0.00014734070 * cos(2.11846597870 + 639.89728631000 * Tau)
      + 0.00009916668 * cos(5.79003189410 + 419.48464388000 * Tau)
      + 0.00006993564 * cos(4.73604689180 +   7.11354700080 * Tau)
      + 0.00004807587 * cos(5.43305315600 + 316.39186966000 * Tau)
      + 0.00004788392 * cos(4.96512927420 + 110.20632122000 * Tau)
      + 0.00003432125 * cos(2.73255752120 + 433.71173788000 * Tau)
      + 0.00001506129 * cos(6.01304536140 + 103.09277422000 * Tau)
      + 0.00001060298 * cos(5.63099292410 + 529.69096509000 * Tau)
      + 0.00000969071 * cos(5.20434966100 + 632.78373931000 * Tau)
      + 0.00000942050 * cos(1.39646678090 + 853.19638175000 * Tau)
      + 0.00000707645 * cos(3.80302329550 + 323.50541666000 * Tau)
      + 0.00000552313 * cos(5.13149109040 + 202.25339517000 * Tau)
      + 0.00000399675 * cos(3.35891413960 + 227.52618944000 * Tau)
      + 0.00000319380 * cos(3.62571550980 + 209.36694217000 * Tau)
      + 0.00000316063 * cos(1.99716764200 + 647.01083331000 * Tau)
      + 0.00000314225 * cos(0.46510272410 + 217.23124870000 * Tau)
      + 0.00000284494 * cos(4.88648481620 + 224.34479570000 * Tau)
      + 0.00000236442 * cos(2.13887472280 +  11.04570026400 * Tau)
      + 0.00000215354 * cos(5.94982610100 + 846.08283475000 * Tau)
      + 0.00000208522 * cos(2.12003893770 + 415.55249061000 * Tau)
      + 0.00000207213 * cos(0.73021462851 + 199.07200144000 * Tau)
      + 0.00000178958 * cos(2.95361514670 +  63.73589830300 * Tau)
      + 0.00000140585 * cos(0.64417620299 + 490.33408918000 * Tau)
      + 0.00000139240 * cos(4.59535168020 +  14.22709400200 * Tau)
      + 0.00000139140 * cos(1.99821990940 + 735.87651353000 * Tau)
      + 0.00000134884 * cos(5.24500819600 + 742.99006053000 * Tau)
      + 0.00000121669 * cos(3.11537140880 + 522.57741809000 * Tau)
      + 0.00000115524 * cos(3.10891547170 + 216.48048918000 * Tau)
      + 0.00000114218 * cos(0.96261442133 + 210.11770170000 * Tau);

  B1 := 0.00397554998 * cos(5.33289992560 +  213.29909544000 * Tau)
      + 0.00049478641 * cos(3.14159265360 +    0.00000000000 * Tau)
      + 0.00018571607 * cos(6.09919206380 +  426.59819088000 * Tau)
      + 0.00014800587 * cos(2.30586060520 +  206.18554844000 * Tau)
      + 0.00009643981 * cos(1.69674660120 +  220.41264244000 * Tau)
      + 0.00003757161 * cos(1.25429514020 +  419.48464388000 * Tau)
      + 0.00002716647 * cos(5.91166664790 +  639.89728631000 * Tau)
      + 0.00001455309 * cos(0.85161616532 +  433.71173788000 * Tau)
      + 0.00001290595 * cos(2.91770857090 +    7.11354700080 * Tau)
      + 0.00000852630 * cos(0.43572078997 +  316.39186966000 * Tau)
      + 0.00000297726 * cos(0.91909206723 +  632.78373931000 * Tau)
      + 0.00000292185 * cos(5.31574251270 +  853.19638175000 * Tau)
      + 0.00000284386 * cos(1.61881754770 +  227.52618944000 * Tau)
      + 0.00000275090 * cos(3.88864137340 +  103.09277422000 * Tau)
      + 0.00000172359 * cos(0.05215146556 +  647.01083331000 * Tau)
      + 0.00000166237 * cos(2.44351613170 +  199.07200144000 * Tau)
      + 0.00000158220 * cos(5.20850125770 +  110.20632122000 * Tau)
      + 0.00000127731 * cos(1.20711452530 +  529.69096509000 * Tau)
      + 0.00000109839 * cos(2.45695551630 +  217.23124870000 * Tau)
      + 0.00000081759 * cos(2.75839171350 +  210.11770170000 * Tau)
      + 0.00000081010 * cos(2.86038377190 +   14.22709400200 * Tau)
      + 0.00000068658 * cos(1.65537623150 +  202.25339517000 * Tau)
      + 0.00000065161 * cos(1.25527521310 +  216.48048918000 * Tau)
      + 0.00000061024 * cos(1.25273412090 +  209.36694217000 * Tau)
      + 0.00000059281 * cos(1.82410768230 +  323.50541666000 * Tau)
      + 0.00000046386 * cos(0.81534705304 +  440.82528488000 * Tau)
      + 0.00000036163 * cos(1.81851057690 +  224.34479570000 * Tau)
      + 0.00000034041 * cos(2.83971298000 +  117.31986822000 * Tau)
      + 0.00000033114 * cos(1.30557080010 +  412.37109687000 * Tau)
      + 0.00000032164 * cos(1.18676132340 +  846.08283475000 * Tau)
      + 0.00000027282 * cos(4.64744847590 + 1066.49547720000 * Tau)
      + 0.00000027128 * cos(4.44228739190 +   11.04570026400 * Tau);

  B2 := 0.00020629977 * cos(0.50482422817 + 213.29909544000 * Tau)
      + 0.00003719555 * cos(3.99833475830 + 206.18554844000 * Tau)
      + 0.00001627158 * cos(6.18189939500 + 220.41264244000 * Tau)
      + 0.00001346067 * cos(0.00000000000 +   0.00000000000 * Tau)
      + 0.00000705842 * cos(3.03914308840 + 419.48464388000 * Tau)
      + 0.00000365042 * cos(5.09928680710 + 426.59819088000 * Tau)
      + 0.00000329632 * cos(5.27899210040 + 433.71173788000 * Tau)
      + 0.00000219335 * cos(3.82841533790 + 639.89728631000 * Tau)
      + 0.00000139393 * cos(1.04272623500 +   7.11354700080 * Tau)
      + 0.00000103980 * cos(6.15730992970 + 227.52618944000 * Tau)
      + 0.00000092961 * cos(1.97994412850 + 316.39186966000 * Tau)
      + 0.00000071242 * cos(4.14754353430 + 199.07200144000 * Tau)
      + 0.00000051927 * cos(2.88364833900 + 632.78373931000 * Tau)
      + 0.00000048961 * cos(4.43390206740 + 647.01083331000 * Tau)
      + 0.00000041373 * cos(3.15927770080 + 853.19638175000 * Tau)
      + 0.00000028602 * cos(4.52978327560 + 210.11770170000 * Tau)
      + 0.00000023969 * cos(1.11595912150 +  14.22709400200 * Tau)
      + 0.00000020511 * cos(4.35095844200 + 217.23124870000 * Tau)
      + 0.00000019532 * cos(5.30779711220 + 440.82528488000 * Tau)
      + 0.00000018263 * cos(0.85391476786 + 110.20632122000 * Tau)
      + 0.00000016840 * cos(5.68112084130 + 216.48048918000 * Tau)
      + 0.00000015742 * cos(4.25767226300 + 103.09277422000 * Tau)
      + 0.00000013613 * cos(2.99904334070 + 412.37109687000 * Tau)
      + 0.00000011567 * cos(2.52679928410 + 529.69096509000 * Tau)
      + 0.00000007963 * cos(3.31512423920 + 202.25339517000 * Tau)
      + 0.00000006648 * cos(5.55714129950 + 209.36694217000 * Tau)
      + 0.00000006599 * cos(0.28766025146 + 323.50541666000 * Tau)
      + 0.00000006312 * cos(1.16121321340 + 117.31986822000 * Tau)
      + 0.00000006192 * cos(3.61231886520 + 860.30992875000 * Tau);

  B3 := 0.00000666252 * cos(1.99006340180 +  213.29909544000 * Tau)
      + 0.00000632350 * cos(5.69778316810 +  206.18554844000 * Tau)
      + 0.00000398051 * cos(0.00000000000 +    0.00000000000 * Tau)
      + 0.00000187838 * cos(4.33779804810 +  220.41264244000 * Tau)
      + 0.00000091884 * cos(4.84104208220 +  419.48464388000 * Tau)
      + 0.00000051548 * cos(3.42149490330 +  433.71173788000 * Tau)
      + 0.00000042369 * cos(2.38073239060 +  426.59819088000 * Tau)
      + 0.00000025661 * cos(4.40167213110 +  227.52618944000 * Tau)
      + 0.00000020551 * cos(5.85313509870 +  199.07200144000 * Tau)
      + 0.00000018081 * cos(1.99321433230 +  639.89728631000 * Tau)
      + 0.00000010874 * cos(5.37344546550 +    7.11354700080 * Tau)
      + 0.00000009590 * cos(2.54901825870 +  647.01083331000 * Tau)
      + 0.00000007085 * cos(3.45518372720 +  316.39186966000 * Tau)
      + 0.00000006002 * cos(4.80055225130 +  632.78373931000 * Tau)
      + 0.00000005778 * cos(0.01680378777 +  210.11770170000 * Tau)
      + 0.00000005542 * cos(3.51756747770 +  440.82528488000 * Tau)
      + 0.00000004881 * cos(5.63719730880 +   14.22709400200 * Tau)
      + 0.00000004501 * cos(1.22424419010 +  853.19638175000 * Tau)
      + 0.00000003548 * cos(4.71299370890 +  412.37109687000 * Tau)
      + 0.00000002851 * cos(0.62679207578 +  103.09277422000 * Tau)
      + 0.00000002173 * cos(3.71982274460 +  216.48048918000 * Tau);

  B4 := 0.00000080384 * cos(1.11918414680 + 206.18554844000 * Tau)
      + 0.00000031660 * cos(3.12218745100 + 213.29909544000 * Tau)
      + 0.00000017143 * cos(2.48073200410 + 220.41264244000 * Tau)
      + 0.00000011844 * cos(3.14159265360 +   0.00000000000 * Tau)
      + 0.00000009005 * cos(0.38441424927 + 419.48464388000 * Tau)
      + 0.00000006164 * cos(1.56186379540 + 433.71173788000 * Tau)
      + 0.00000004775 * cos(2.63498295490 + 227.52618944000 * Tau)
      + 0.00000004660 * cos(1.28235639570 + 199.07200144000 * Tau)
      + 0.00000001487 * cos(1.43096671620 + 426.59819088000 * Tau)
      + 0.00000001424 * cos(0.66988083613 + 647.01083331000 * Tau)
      + 0.00000001145 * cos(1.72041928130 + 440.82528488000 * Tau)
      + 0.00000001075 * cos(6.18092274060 + 639.89728631000 * Tau);

  B5 := 0.00000007895 * cos(2.81927558650 + 206.18554844000 * Tau)
      + 0.00000001014 * cos(0.51187210270 + 220.41264244000 * Tau);
  Result := (B0 + B1*Tau + B2*Tau2 + B3*Tau3 + B4*Tau4 + B5*Tau5);
end;

{---------------------------------------------------------------------------}

function GetRadiusVector(Tau, Tau2, Tau3, Tau4, Tau5 : Double) : Double;
var
  R0, R1,
  R2, R3,
  R4, R5  : Double;
begin
  R0 := 9.55758135800 * cos(0.00000000000 +    0.00000000000 * Tau)
      + 0.52921382465 * cos(2.39226219730 +  213.29909544000 * Tau)
      + 0.01873679934 * cos(5.23549605090 +  206.18554844000 * Tau)
      + 0.01464663959 * cos(1.64763045470 +  426.59819088000 * Tau)
      + 0.00821891059 * cos(5.93520025370 +  316.39186966000 * Tau)
      + 0.00547506899 * cos(5.01532628450 +  103.09277422000 * Tau)
      + 0.00371684449 * cos(2.27114833430 +  220.41264244000 * Tau)
      + 0.00361778433 * cos(3.13904303260 +    7.11354700080 * Tau)
      + 0.00140617548 * cos(5.70406652990 +  632.78373931000 * Tau)
      + 0.00108974737 * cos(3.29313595580 +  110.20632122000 * Tau)
      + 0.00069007015 * cos(5.94099622450 +  419.48464388000 * Tau)
      + 0.00061053350 * cos(0.94037761156 +  639.89728631000 * Tau)
      + 0.00048913044 * cos(1.55733388470 +  202.25339517000 * Tau)
      + 0.00034143794 * cos(0.19518550682 +  277.03499374000 * Tau)
      + 0.00032401718 * cos(5.47084606950 +  949.17560897000 * Tau)
      + 0.00020936573 * cos(0.46349163993 +  735.87651353000 * Tau)
      + 0.00020839118 * cos(1.52102590640 +  433.71173788000 * Tau)
      + 0.00020746678 * cos(5.33255667600 +  199.07200144000 * Tau)
      + 0.00015298457 * cos(3.05943652880 +  529.69096509000 * Tau)
      + 0.00014296479 * cos(2.60433537910 +  323.50541666000 * Tau)
      + 0.00012884128 * cos(1.64892310390 +  138.51749687000 * Tau)
      + 0.00011993314 * cos(5.98051421880 +  846.08283475000 * Tau)
      + 0.00011380261 * cos(1.73105746570 +  522.57741809000 * Tau)
      + 0.00009796061 * cos(5.20475864000 + 1265.56747860000 * Tau)
      + 0.00007752769 * cos(5.85191318900 +   95.97922721800 * Tau)
      + 0.00006770621 * cos(3.00433479280 +   14.22709400200 * Tau)
      + 0.00006465967 * cos(0.17733160145 + 1052.26838320000 * Tau)
      + 0.00005850443 * cos(1.45519636080 +  415.55249061000 * Tau)
      + 0.00005307481 * cos(0.59737534050 +   63.73589830300 * Tau)
      + 0.00004695746 * cos(2.14919036960 +  227.52618944000 * Tau)
      + 0.00004043988 * cos(1.64010323860 +  209.36694217000 * Tau)
      + 0.00003688132 * cos(0.78016133170 +  412.37109687000 * Tau)
      + 0.00003460943 * cos(1.85088802880 +  175.16605980000 * Tau)
      + 0.00003419551 * cos(4.94549148890 + 1581.95934830000 * Tau)
      + 0.00003400616 * cos(0.55386747515 +  350.33211960000 * Tau)
      + 0.00003376457 * cos(3.69528478830 +  224.34479570000 * Tau)
      + 0.00002976033 * cos(5.68467931120 +  210.11770170000 * Tau)
      + 0.00002885348 * cos(1.38764077630 +  838.96928775000 * Tau)
      + 0.00002881181 * cos(0.17960757891 +  853.19638175000 * Tau)
      + 0.00002507630 * cos(3.53851863260 +  742.99006053000 * Tau)
      + 0.00002448325 * cos(6.18412386320 + 1368.66025280000 * Tau)
      + 0.00002406138 * cos(2.96559220270 +  117.31986822000 * Tau)
      + 0.00002173959 * cos(0.01508587396 +  340.77089205000 * Tau)
      + 0.00002024483 * cos(5.05411271270 +   11.04570026400 * Tau);

  R1 := 0.06182981282 * cos(0.25843515034 +  213.29909544000 * Tau)
      + 0.00506577574 * cos(0.71114650941 +  206.18554844000 * Tau)
      + 0.00341394136 * cos(5.79635773960 +  426.59819088000 * Tau)
      + 0.00188491375 * cos(0.47215719444 +  220.41264244000 * Tau)
      + 0.00186261540 * cos(3.14159265360 +    0.00000000000 * Tau)
      + 0.00143891176 * cos(1.40744864240 +    7.11354700080 * Tau)
      + 0.00049621111 * cos(6.01744469580 +  103.09277422000 * Tau)
      + 0.00020928189 * cos(5.09245654470 +  639.89728631000 * Tau)
      + 0.00019952612 * cos(1.17560125010 +  419.48464388000 * Tau)
      + 0.00018839639 * cos(1.60819563170 +  110.20632122000 * Tau)
      + 0.00013876565 * cos(0.75886204364 +  199.07200144000 * Tau)
      + 0.00012892827 * cos(5.94330258430 +  433.71173788000 * Tau)
      + 0.00005396699 * cos(1.28852405910 +   14.22709400200 * Tau)
      + 0.00004869308 * cos(0.86793894213 +  323.50541666000 * Tau)
      + 0.00004247455 * cos(0.39299384543 +  227.52618944000 * Tau)
      + 0.00003252084 * cos(1.25853470490 +   95.97922721800 * Tau)
      + 0.00003081408 * cos(3.43662557420 +  522.57741809000 * Tau)
      + 0.00002909411 * cos(4.60679154790 +  202.25339517000 * Tau)
      + 0.00002856006 * cos(2.16731405370 +  735.87651353000 * Tau)
      + 0.00001987689 * cos(2.45054204800 +  412.37109687000 * Tau)
      + 0.00001941309 * cos(6.02393385140 +  209.36694217000 * Tau)
      + 0.00001581446 * cos(1.29191789710 +  210.11770170000 * Tau)
      + 0.00001339511 * cos(4.30801821810 +  853.19638175000 * Tau)
      + 0.00001315590 * cos(1.25296446020 +  117.31986822000 * Tau)
      + 0.00001203085 * cos(1.86654673790 +  316.39186966000 * Tau)
      + 0.00001091088 * cos(0.07527246854 +  216.48048918000 * Tau)
      + 0.00000966012 * cos(0.47991379141 +  632.78373931000 * Tau)
      + 0.00000954403 * cos(5.15173410520 +  647.01083331000 * Tau)
      + 0.00000897512 * cos(0.98343776092 +  529.69096509000 * Tau)
      + 0.00000881827 * cos(1.88471724480 + 1052.26838320000 * Tau)
      + 0.00000874215 * cos(1.40224683860 +  224.34479570000 * Tau)
      + 0.00000784866 * cos(3.06377517460 +  838.96928775000 * Tau)
      + 0.00000739892 * cos(1.38225356690 +  625.67019231000 * Tau)
      + 0.00000658210 * cos(4.14362930980 +  309.27832266000 * Tau)
      + 0.00000649600 * cos(1.72489486160 +  742.99006053000 * Tau)
      + 0.00000612961 * cos(3.03307306770 +   63.73589830300 * Tau)
      + 0.00000599236 * cos(2.54924174760 +  217.23124870000 * Tau)
      + 0.00000502886 * cos(2.12958819480 +    3.93215326310 * Tau);

  R2 := 0.00436902464 * cos(4.78671673040 + 213.29909544000 * Tau)
      + 0.00071922760 * cos(2.50069994870 + 206.18554844000 * Tau)
      + 0.00049766792 * cos(4.97168150870 + 220.41264244000 * Tau)
      + 0.00043220894 * cos(3.86940443790 + 426.59819088000 * Tau)
      + 0.00029645554 * cos(5.96310264280 +   7.11354700080 * Tau)
      + 0.00004720909 * cos(2.47527992420 + 199.07200144000 * Tau)
      + 0.00004141650 * cos(4.10670940820 + 433.71173788000 * Tau)
      + 0.00003789370 * cos(3.09771025070 + 639.89728631000 * Tau)
      + 0.00002963990 * cos(1.37206248850 + 103.09277422000 * Tau)
      + 0.00002556363 * cos(2.85065721530 + 419.48464388000 * Tau)
      + 0.00002326801 * cos(0.00000000000 +   0.00000000000 * Tau)
      + 0.00002208457 * cos(6.27588858710 + 110.20632122000 * Tau)
      + 0.00002187621 * cos(5.85545832220 +  14.22709400200 * Tau)
      + 0.00001956896 * cos(4.92448618040 + 227.52618944000 * Tau)
      + 0.00000923840 * cos(5.46392422740 + 323.50541666000 * Tau)
      + 0.00000705936 * cos(2.97081280100 +  95.97922721800 * Tau)
      + 0.00000546115 * cos(4.12854181520 + 412.37109687000 * Tau)
      + 0.00000431485 * cos(5.17825414610 + 522.57741809000 * Tau)
      + 0.00000405018 * cos(4.17294157870 + 209.36694217000 * Tau)
      + 0.00000390627 * cos(4.48106176890 + 216.48048918000 * Tau)
      + 0.00000373838 * cos(5.83435991810 + 117.31986822000 * Tau)
      + 0.00000360882 * cos(3.27703082370 + 647.01083331000 * Tau)
      + 0.00000356350 * cos(3.19152043940 + 210.11770170000 * Tau)
      + 0.00000325598 * cos(2.26867601660 + 853.19638175000 * Tau)
      + 0.00000206854 * cos(4.02188336740 + 735.87651353000 * Tau)
      + 0.00000204494 * cos(0.08774848590 + 202.25339517000 * Tau)
      + 0.00000180143 * cos(3.59704903950 + 632.78373931000 * Tau)
      + 0.00000178474 * cos(4.09716541450 + 440.82528488000 * Tau)
      + 0.00000153656 * cos(3.13470530380 + 625.67019231000 * Tau)
      + 0.00000147779 * cos(0.13614300541 + 302.16477566000 * Tau)
      + 0.00000133076 * cos(2.59350469420 + 191.95845444000 * Tau)
      + 0.00000131975 * cos(5.93293968940 + 309.27832266000 * Tau);

  R3 := 0.00020315005 * cos(3.02186626040 + 213.29909544000 * Tau)
      + 0.00008923581 * cos(3.19144205750 + 220.41264244000 * Tau)
      + 0.00006908677 * cos(4.35174889350 + 206.18554844000 * Tau)
      + 0.00004087129 * cos(4.22406927380 +   7.11354700080 * Tau)
      + 0.00003879041 * cos(2.01056445990 + 426.59819088000 * Tau)
      + 0.00001070788 * cos(4.20360341240 + 199.07200144000 * Tau)
      + 0.00000907332 * cos(2.28344368030 + 433.71173788000 * Tau)
      + 0.00000606121 * cos(3.17458570530 + 227.52618944000 * Tau)
      + 0.00000596639 * cos(4.13455753350 +  14.22709400200 * Tau)
      + 0.00000483181 * cos(1.17345973260 + 639.89728631000 * Tau)
      + 0.00000393174 * cos(0.00000000000 +   0.00000000000 * Tau)
      + 0.00000229472 * cos(4.69838526380 + 419.48464388000 * Tau)
      + 0.00000188250 * cos(4.59003889010 + 110.20632122000 * Tau)
      + 0.00000149508 * cos(3.20199444400 + 103.09277422000 * Tau)
      + 0.00000121442 * cos(3.76831374100 + 323.50541666000 * Tau)
      + 0.00000102146 * cos(4.70974422800 +  95.97922721800 * Tau)
      + 0.00000101215 * cos(5.81884137750 + 412.37109687000 * Tau)
      + 0.00000093078 * cos(1.43531270910 + 647.01083331000 * Tau)
      + 0.00000084347 * cos(2.63462379690 + 216.48048918000 * Tau)
      + 0.00000072601 * cos(4.15395598510 + 117.31986822000 * Tau)
      + 0.00000062198 * cos(2.31239345500 + 440.82528488000 * Tau)
      + 0.00000054829 * cos(0.30526468471 + 853.19638175000 * Tau)
      + 0.00000049536 * cos(2.38854232910 + 209.36694217000 * Tau)
      + 0.00000045145 * cos(4.37317047300 + 191.95845444000 * Tau)
      + 0.00000040671 * cos(0.68845183210 + 522.57741809000 * Tau)
      + 0.00000040498 * cos(1.83836569760 + 302.16477566000 * Tau)
      + 0.00000038089 * cos(5.94455115520 +  88.86568021700 * Tau)
      + 0.00000032243 * cos(4.01146349390 +  21.34064100200 * Tau);

  R4 := 0.00001202050 * cos(1.41499446470 + 220.41264244000 * Tau)
      + 0.00000707796 * cos(1.16153570100 + 213.29909544000 * Tau)
      + 0.00000516121 * cos(6.23973568330 + 206.18554844000 * Tau)
      + 0.00000426664 * cos(2.46924890290 +   7.11354700080 * Tau)
      + 0.00000267736 * cos(0.18659206741 + 426.59819088000 * Tau)
      + 0.00000170171 * cos(5.95926972380 + 199.07200144000 * Tau)
      + 0.00000150339 * cos(0.47970167140 + 433.71173788000 * Tau)
      + 0.00000145113 * cos(1.44211060140 + 227.52618944000 * Tau)
      + 0.00000121033 * cos(2.40527320820 +  14.22709400200 * Tau)
      + 0.00000047332 * cos(5.56857488680 + 639.89728631000 * Tau)
      + 0.00000018954 * cos(5.85626429120 + 647.01083331000 * Tau)
      + 0.00000016668 * cos(0.52920774279 + 440.82528488000 * Tau)
      + 0.00000015745 * cos(2.90112466280 + 110.20632122000 * Tau)
      + 0.00000014724 * cos(0.29905316786 + 419.48464388000 * Tau)
      + 0.00000014074 * cos(1.30343550660 + 412.37109687000 * Tau)
      + 0.00000012708 * cos(2.09349305930 + 323.50541666000 * Tau)
      + 0.00000011320 * cos(0.21785507019 +  95.97922721800 * Tau)
      + 0.00000011133 * cos(2.46304825990 + 117.31986822000 * Tau)
      + 0.00000009552 * cos(3.14159265360 +   0.00000000000 * Tau)
      + 0.00000009246 * cos(1.56496312830 +  88.86568021700 * Tau)
      + 0.00000009233 * cos(2.28127318070 +  21.34064100200 * Tau)
      + 0.00000008970 * cos(0.68301278041 + 216.48048918000 * Tau)
      + 0.00000008360 * cos(1.27239488460 + 234.63973644000 * Tau);

  R5 := 0.00000128612 * cos(5.91282565140 + 220.41264244000 * Tau)
      + 0.00000032273 * cos(0.69256228602 +   7.11354700080 * Tau)
      + 0.00000026698 * cos(5.91428528630 + 227.52618944000 * Tau)
      + 0.00000020223 * cos(4.95136801770 + 433.71173788000 * Tau)
      + 0.00000019923 * cos(0.67370653385 +  14.22709400200 * Tau)
      + 0.00000014097 * cos(2.67074280190 + 206.18554844000 * Tau)
      + 0.00000013537 * cos(1.45669521410 + 199.07200144000 * Tau)
      + 0.00000013364 * cos(4.58826996370 + 426.59819088000 * Tau)
      + 0.00000007257 * cos(4.62966127160 + 213.29909544000 * Tau)
      + 0.00000004876 * cos(3.61448275000 + 639.89728631000 * Tau)
      + 0.00000003759 * cos(4.89624165040 + 440.82528488000 * Tau)
      + 0.00000003303 * cos(4.07190859540 + 647.01083331000 * Tau)
      + 0.00000003136 * cos(4.65661021910 + 191.95845444000 * Tau)
      + 0.00000002917 * cos(0.48665273315 + 323.50541666000 * Tau)
      + 0.00000002883 * cos(3.18003019200 + 419.48464388000 * Tau)
      + 0.00000002338 * cos(3.69553554330 +  88.86568021700 * Tau)
      + 0.00000002052 * cos(3.31663577370 +  95.97922721800 * Tau)
      + 0.00000002028 * cos(0.56025552769 + 117.31986822000 * Tau);
  Result := (R0 + R1*Tau + R2*Tau2 + R3*Tau3 + R4*Tau4 + R5*Tau5);
end;

{---------------------------------------------------------------------------}

function ComputeSaturn(JD : Double) : TStEclipticalCord;
var
  Tau,
  Tau2,
  Tau3,
  Tau4,
  Tau5      : Double;
begin
  Tau  := (JD - 2451545.0) / 365250.0;
  Tau2 := sqr(Tau);
  Tau3 := Tau * Tau2;
  Tau4 := sqr(Tau2);
  Tau5 := Tau2 * Tau3;

  Result.L0 := GetLongitude(Tau, Tau2, Tau3, Tau4, Tau5);
  Result.B0 := GetLatitude(Tau, Tau2, Tau3, Tau4, Tau5);
  Result.R0 := GetRadiusVector(Tau, Tau2, Tau3, Tau4, Tau5);
end;


end.
